/**
 * Created by losor on 2017/3/15.
 */
public class _27_RemoveElement {

    public static void main(String[] args) {

    }
    public static int removeElement(int[] nums, int val) {
        int index = 0;
        for (int i = 0; i < nums.length; i++) {
            if (nums[i] != val){
                nums[index] = nums[i];
                index++;
            }
        }
        return index;
    }
}
